home *** CD-ROM | disk | FTP | other *** search
/ Digitalfoto 118 / Digitalfoto 118.iso / mac / programas / 00 / start.swf / scripts / frame_1 / DoAction_10.as next >
Text File  |  2009-11-16  |  6KB  |  237 lines

  1. function loadWelcome()
  2. {
  3.    welcome = new XML();
  4.    welcome.ignoreWhite = true;
  5.    welcome.onLoad = function(success)
  6.    {
  7.       this.clearLoadCheck();
  8.       if(success)
  9.       {
  10.          renderSettings();
  11.       }
  12.    };
  13.    welcome.onBytesLoaded = function(bytesLoaded, bytesTotal, kbLoaded, kbTotal, percentLoaded)
  14.    {
  15.    };
  16.    welcome.preload(fsp_path + folder + "config/welcome.xml",false);
  17. }
  18. function loadOnline()
  19. {
  20.    if(client_os == "Windows")
  21.    {
  22.       mdm.Forms.SplashForm.callFunction("output","Loading online..","");
  23.    }
  24.    online = new XML();
  25.    online.ignoreWhite = true;
  26.    online.onLoad = function(success)
  27.    {
  28.       this.clearLoadCheck();
  29.       if(success)
  30.       {
  31.          loadWelcome();
  32.       }
  33.    };
  34.    online.onBytesLoaded = function(bytesLoaded, bytesTotal, kbLoaded, kbTotal, percentLoaded)
  35.    {
  36.    };
  37.    online.preload(fsp_path + folder + "config/online.xml",false);
  38. }
  39. function loadHelp()
  40. {
  41.    if(client_os == "Windows")
  42.    {
  43.       mdm.Forms.SplashForm.callFunction("output","Loading help..","");
  44.    }
  45.    help = new XML();
  46.    help.ignoreWhite = true;
  47.    help.onLoad = function(success)
  48.    {
  49.       this.clearLoadCheck();
  50.       if(success)
  51.       {
  52.          loadOnline();
  53.       }
  54.    };
  55.    help.onBytesLoaded = function(bytesLoaded, bytesTotal, kbLoaded, kbTotal, percentLoaded)
  56.    {
  57.    };
  58.    help.preload(fsp_path + folder + "config/help.xml",false);
  59. }
  60. function loadStyles()
  61. {
  62.    if(client_os == "Windows")
  63.    {
  64.       mdm.Forms.SplashForm.callFunction("output","Loading styles..","");
  65.    }
  66.    styles = new XML();
  67.    styles.ignoreWhite = true;
  68.    styles.onLoad = function(success)
  69.    {
  70.       this.clearLoadCheck();
  71.       if(success)
  72.       {
  73.          loadHelp();
  74.       }
  75.    };
  76.    styles.onBytesLoaded = function(bytesLoaded, bytesTotal, kbLoaded, kbTotal, percentLoaded)
  77.    {
  78.    };
  79.    styles.preload(fsp_path + folder + "config/styles.xml",false);
  80. }
  81. function loadContent()
  82. {
  83.    if(client_os == "Windows")
  84.    {
  85.       mdm.Forms.SplashForm.callFunction("output","Loading content..","");
  86.    }
  87.    cd_content = new XML();
  88.    cd_content.ignoreWhite = true;
  89.    cd_content.onLoad = function(success)
  90.    {
  91.       this.clearLoadCheck();
  92.       if(success)
  93.       {
  94.          notifyDebugger("Before RenderVideoDataArray");
  95.          renderVideoDataArray(cd_content.firstChild.childNodes,[0]);
  96.       }
  97.    };
  98.    cd_content.onBytesLoaded = function(bytesLoaded, bytesTotal, kbLoaded, kbTotal, percentLoaded)
  99.    {
  100.       if(client_os == "Windows")
  101.       {
  102.          mdm.Forms.SplashForm.callFunction("output","Loading Content " + percentLoaded + "%","");
  103.       }
  104.    };
  105.    cd_content.preload(fsp_path + folder + "config/content.xml",false);
  106. }
  107. function loadSettings()
  108. {
  109.    if(client_os == "Windows")
  110.    {
  111.       mdm.Forms.SplashForm.callFunction("output","Loading settings..","");
  112.    }
  113.    settings = new XML();
  114.    settings.ignoreWhite = true;
  115.    settings.onLoad = function(success)
  116.    {
  117.       this.clearLoadCheck();
  118.       if(success)
  119.       {
  120.          loadStyles();
  121.       }
  122.    };
  123.    settings.onBytesLoaded = function(bytesLoaded, bytesTotal, kbLoaded, kbTotal, percentLoaded)
  124.    {
  125.    };
  126.    settings.preload(fsp_path + folder + "config/settings.xml",false);
  127. }
  128. function loadClip(_file, _mc, __width, __height, __scale_mode, __bitmap, __function, _fade, __visible, __initialize, __callback)
  129. {
  130.    var mcLoaderListener = new Object();
  131.    var clipMCL = new MovieClipLoader();
  132.    mcLoaderListener.onLoadStart = function(targetMC)
  133.    {
  134.       targetMC._visible = false;
  135.    };
  136.    mcLoaderListener.onLoadProgress = function(targetMC, loadedBytes, totalBytes)
  137.    {
  138.    };
  139.    mcLoaderListener.onLoadComplete = function(targetMC)
  140.    {
  141.    };
  142.    mcLoaderListener.onLoadInit = function(targetMC)
  143.    {
  144.       if(__bitmap)
  145.       {
  146.          var _loc3_ = new flash.display.BitmapData(targetMC._width,targetMC._height,true,16777215);
  147.          _loc3_.draw(targetMC);
  148.          targetMC.attachBitmap(_loc3_,1,"auto",true);
  149.       }
  150.       if(__scale_mode == "fullfixed")
  151.       {
  152.          faktor1 = Stage.width / targetMC._width;
  153.          faktor2 = Stage.height / targetMC._height;
  154.          if(faktor1 > faktor2)
  155.          {
  156.             ratio = faktor1;
  157.          }
  158.          else
  159.          {
  160.             ratio = faktor2;
  161.          }
  162.          targetMC._width *= ratio;
  163.          targetMC._height *= ratio;
  164.       }
  165.       else if(__scale_mode == "widthfixed")
  166.       {
  167.          ratio = __width / targetMC._width;
  168.          targetMC._width = __width;
  169.          targetMC._height *= ratio;
  170.       }
  171.       else if(__scale_mode == "heightfixed")
  172.       {
  173.          ratio = __height / targetMC._height;
  174.          targetMC._width *= ratio;
  175.          targetMC._height = __height;
  176.       }
  177.       else if(__scale_mode == "widthfixedmasked")
  178.       {
  179.          _mc._parent.createEmptyMovieClip("target_mask_mc",_mc._parent.getNextHighestDepth());
  180.          _mc._parent.target_mask_mc._y = _mc._y;
  181.          _mc._parent.target_mask_mc._visible = false;
  182.          _root.drawBox(_mc._parent.target_mask_mc,__width,__height,16711680,16711680,100,100,"linear");
  183.          targetMC.setMask(_mc._parent.target_mask_mc);
  184.          ratio = __width / targetMC._width;
  185.          targetMC._width = __width;
  186.          targetMC._height *= ratio;
  187.       }
  188.       else if(__scale_mode == "mc_centered")
  189.       {
  190.          targetMC._x = Math.round(__width / 2 - targetMC._width / 2);
  191.          targetMC._y = Math.round(__height / 2 - targetMC._height / 2);
  192.       }
  193.       else
  194.       {
  195.          if(__width)
  196.          {
  197.             targetMC._width = __width;
  198.          }
  199.          if(__height)
  200.          {
  201.             targetMC._height = __height;
  202.          }
  203.       }
  204.       if(__function)
  205.       {
  206.          __function();
  207.       }
  208.       if(__visible)
  209.       {
  210.          targetMC._alpha = 0;
  211.          targetMC._visible = true;
  212.          if(_fade)
  213.          {
  214.             targetMC.tween("_alpha",100,1,"easeOutQuart");
  215.          }
  216.          else
  217.          {
  218.             targetMC._alpha = 100;
  219.          }
  220.       }
  221.       if(__initialize)
  222.       {
  223.          targetMC.init();
  224.       }
  225.       if(__callback)
  226.       {
  227.          __callback();
  228.       }
  229.       clipMCL.removeListener(mcLoaderListener);
  230.    };
  231.    mcLoaderListener.onLoadError = function(targetMC, errorCode)
  232.    {
  233.    };
  234.    clipMCL.addListener(mcLoaderListener);
  235.    clipMCL.loadClip(_file,_mc);
  236. }
  237.